package com.song.su.mapper;

import com.song.su.model.BookDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface BookDetailMapper {

    // 提供搜索
    @Select("select * from bookdetail where book_names like '%${name}%'")
    List<BookDetail> findByname(@Param("name") String name);

    // list
    @Select("select * from bookdetail")
    List<BookDetail> findAll();

//    提供查看 bookController isbn对应唯一一本书
    @Select("select * from bookdetail where book_isbn=#{isbn}")
    BookDetail findBook(@Param("isbn") String isbn);
}
